package com.cate.constants;

/**
 * @CreateTime: 2023/7/4
 * @Author: <==lhd==>
 * @Description: 正则表达式常量
 */
public class RegexPatterns {

    /**
     * 手机号正则
     */
    public static final String PHONE_REGEX = "^1([38][0-9]|4[579]|5[0-3,5-9]|6[2567]|7[0-8]|9[0-3,5-9])\\d{8}$";

    /**
     * 邮箱正则
     */
    public static final String EMAIL_REGEX = "^[a-zA-Z0-9_-]+@[a-zA-Z0-9_-]+(\\.[a-zA-Z0-9_-]+)+$";

    /**
     * 密码正则。4~32位的字母、数字、下划线
     */
    public static final String PASSWORD_REGEX = "^\\w{4,32}$";

    /**
     * 验证码正则, 6位数字或字母
     */
    public static final String VERIFY_CODE_REGEX = "^[a-zA-Z\\d]{4}$";

    /**
     *  时间正则：YYYY-MM-ddThh:mm:ss
     */
    public static final String TIME_FORMAT_REGEX = "^(((20[0-3][0-9]-(0[13578]|1[02])-(0[1-9]|[12][0-9]|3[01]))|" +
            "(20[0-3][0-9]-(0[2469]|11)-(0[1-9]|[12][0-9]|30)))T(20|21|22|23|[0-1][0-9]):[0-5][0-9]:[0-5][0-9])$";

    /**
     * 身份证正则表达式
     */
    public static final String ID_CARD_REGEX = "^[1-9]\\d{5}(18|19|20)\\d{2}((0[1-9])|(1[0-2]))(([0-2][1-9])|10|20|30|31)\\d{3}[0-9Xx]$";
}
